package com.chejianer.phone.utils;

/**
 * Created by Chejianer on 2016/9/1.
 */
public class CreateCodeUtil {
    public static String createCode(int user_id){
        String root="01";
        String num="";
        if(user_id<10){
          num="000"+user_id;
        }else if(user_id<100){
            num="00"+user_id;
        }else if(user_id<1000){
            num="0"+user_id;
        }else{
            num=""+user_id;
        }
        return root+num;
    }
    public static void main(String[] args){
        System.out.println(createCode(1));
        System.out.println(createCode(22));
        System.out.println(createCode(321));
        System.out.println(createCode(1000));
        System.out.println(createCode(3213));
        //System.out.println(createCode(111111));

    }
}
